{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "MDTraj provides convenience functions for predicting various NMR observables such as chemical shifts.  To do this, we provide wrapper functions for the SPARTA+, PPM, and ShiftX2 prediction algorithms.  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import mdtraj as md"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's load a simple trajectory containing three identical frames of the villin headpiece protein."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "trj = md.load(\"1vii_3frames.pdb\", no_boxchk=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now, let's calculate the chemical shifts with the program SPARTA+."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "shifts = md.nmr.chemical_shifts_spartaplus(trj)\n",
    "shifts[0:10]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The data is returned as a Pandas Dataframe object. The rows correspond to the residue numbers and atom names, while each column corresponds to a different frame in your trajectory.  Note that here our input had completely identical conformations in each frame, so we see identical values along each row."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
